package com.ysq.storage.domain;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.TreeEntity;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * 商品分类对象 sys_product_category
 *
 * @author ysq
 * @date 2025-07-23
 */
public class ProductCategory extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 分类唯一标识
     */
    @TableId
    private Long categoryId;

    /**
     * 分类编码（层次码）
     */
    @Excel(name = "分类编码", readConverterExp = "层=次码")
    private String categoryCode;

    /**
     * 分类名称
     */
    @Excel(name = "分类名称")
    private String categoryName;

    /**
     * 分类层级
     */
    @Excel(name = "分类层级")
    private Integer categoryLevel;

    /**
     * 排序序号
     */
    @Excel(name = "排序序号")
    private Integer sortOrder;

    /**
     * 状态
     */
    @Excel(name = "状态")
    private String status;

    /**
     * 分类说明
     */
    @Excel(name = "分类说明")
    private String description;
    /**
     * 创建人id
     */
    @TableField(fill = FieldFill.INSERT)
    @Excel(name = "创建人id")
    private Long createUserId;
    /**
     * 修改人id
     */
    @TableField(fill = FieldFill.INSERT)
    @Excel(name = "修改人id")
    private Long updateUserId;
    /**
     * 父菜单名称
     */
    @TableField(exist = false)
    private String parentName;

    /**
     * 父菜单ID
     */
    private Long parentId;

    /**
     * 显示顺序
     */
    @TableField(exist = false)
    private Integer orderNum;

    /**
     * 祖级列表
     */
    @TableField(exist = false)
    private String ancestors;

    /**
     * 子部门
     */
    @TableField(exist = false)
    private List<ProductCategory> children = new ArrayList<>();

    public Long getCategoryId() {
        return categoryId;
    }

    public void setCategoryId(Long categoryId) {
        this.categoryId = categoryId;
    }

    public String getCategoryCode() {
        return categoryCode;
    }

    public void setCategoryCode(String categoryCode) {
        this.categoryCode = categoryCode;
    }

    public String getCategoryName() {
        return categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    public Integer getCategoryLevel() {
        return categoryLevel;
    }

    public void setCategoryLevel(Integer categoryLevel) {
        this.categoryLevel = categoryLevel;
    }

    public Integer getSortOrder() {
        return sortOrder;
    }

    public void setSortOrder(Integer sortOrder) {
        this.sortOrder = sortOrder;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Long getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(Long createUserId) {
        this.createUserId = createUserId;
    }

    public Long getUpdateUserId() {
        return updateUserId;
    }

    public void setUpdateUserId(Long updateUserId) {
        this.updateUserId = updateUserId;
    }

    public String getParentName() {
        return parentName;
    }

    public void setParentName(String parentName) {
        this.parentName = parentName;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public Integer getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(Integer orderNum) {
        this.orderNum = orderNum;
    }

    public String getAncestors() {
        return ancestors;
    }

    public void setAncestors(String ancestors) {
        this.ancestors = ancestors;
    }

    public List<ProductCategory> getChildren() {
        return children;
    }

    public void setChildren(List<ProductCategory> children) {
        this.children = children;
    }

    @Override
    public String toString() {
        return "ProductCategory{" +
                "categoryId=" + categoryId +
                ", categoryCode='" + categoryCode + '\'' +
                ", categoryName='" + categoryName + '\'' +
                ", categoryLevel=" + categoryLevel +
                ", sortOrder=" + sortOrder +
                ", status='" + status + '\'' +
                ", description='" + description + '\'' +
                ", createUserId=" + createUserId +
                ", updateUserId=" + updateUserId +
                ", parentName='" + parentName + '\'' +
                ", parentId=" + parentId +
                ", orderNum=" + orderNum +
                ", ancestors='" + ancestors + '\'' +
                ", children=" + children +
                '}';
    }
}
